package com.woniuxy.controller.systemcontroller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.github.pagehelper.PageInfo;
import com.woniuxy.pojo.Role;
import com.woniuxy.service.system.RoleService;

@RestController
@RequestMapping("/role")
public class RoleController {

	@Autowired
	private RoleService roleService;
	@RequestMapping("/getAll")
	public PageInfo getAll(Integer pn,String condition) {
		PageInfo pageInfo = roleService.selectAll(pn, condition);
		return pageInfo;
	}
	@RequestMapping("/addRole")
	public void addRole(Role role) {
		roleService.addRole(role);
	}
	@RequestMapping("/updateRole")
	public void updateRole(Role role) {
		roleService.updateRole(role);
	}
	@RequestMapping("/updatePersByRole")
	public void updatePersByRole(Integer rid,String pids) {
		roleService.updatePersByRoleId(rid,pids);
	}
}
